package com.Date.DateTools;
import java.text.ParseException;
import java.util.Date;
public class DateDemo {
    public static void main(String[] args) throws ParseException {
        Date d = new Date();
        String s1 = DateUtils.dateToString(d,"yyyy年MM月dd日  hh时:mm分:ss秒");
        System.out.println("当前时间为:"+s1);
        System.out.println("-----------");
        String s2 = "2022-3-20 22:50:12";
        Date dd = DateUtils.stringToDate(s2,"yyyy-MM-dd hh:mm:ss");
        System.out.println(dd);

    }
}
